<template>
 <div>
    
     <div   class="vide_content">
       
     <div  class="vide_item" v-for="item in videoList" :key="item.vidID">
      <div class="vide_top">
        <router-link :to="{ name: 'videDetail',params:{vid:item.vidID} }">
            <div v-if="item.Cover!=''"><img
            
            style="border-radius: 10px"
            v-lazy="evImage + item.Cover"
            alt=""
          /></div>
          

         <video v-else :src="evImage+item.MediaVideo"></video>
        </router-link>
      </div>
      <p class="vide_title"><van-tag style="margin-right:6px;" v-if="item.MediaType=='视频'" plain color="#7232dd">视频</van-tag>{{ item.message }}</p>
      <div class="vide_bottom">
        <!-- 头像与昵称 -->
        <div class="tip_l">
          <img src="../../assets/images/k.png" alt="" />
          <span>万能青年</span>
        </div>
        <!-- 点赞 -->
        <div class="tip_r">
          <van-icon
            name="like-o"
            size="18"
            @click="likeClick"
            :color="num ? '#F1050A' : ''"
          />
          <transition
            @before-enter="beforeEnter"
            @enter="enter"
            @after-enter="afterEnter"
          >
            <span class="addOne" v-if="isLike">+1</span>
          </transition>

          {{ num }}
        </div>
      </div>
    </div>
  </div>
  </div>
</template>
<script>

export default {
  
  props: { videoList: Array },
  data() {
    return {
      start: 1,
      num: "22", //点赞数
      isLike: false,
    };
  },
  created() {
    // this.GetAllvideoList()
  },
  methods: {
    beforeEnter(el) {
      //动画开始进入前
      el.style.transform = "translate(0,0)";
    },
    enter(el, done) {
      //动画执行时
      el.offsetWidth;
      el.style.transform = "translate(5px,-20px)";
      el.style.transition = "all 0.6s ease";
      done();
    },
    afterEnter(el) {
      //动画结束时
      this.isLike = !this.isLike;
    },
    likeClick() {
      this.isLike = true;
      this.num++;
    },
  },
  watch: {
    title() {
      //  this.selectVideolist()
    },
  },
};
</script>
<style lang="less" scoped>
.vide_content {
  overflow: hidden;
  column-count: 2;
  .vide_item {
    width: 100%;
    -moz-column-break-inside: avoid;
    break-inside: avoid;
    box-sizing: border-box;
    padding: 5px;
    /* margin: 5px; */
    margin-bottom: 10px;
    box-shadow: 1px 2px 5px 2px #eaeaea;
    background: white;
    border-radius: 10px;
  }
  .vide_top {
    // background: black;
    border-radius: 10px;
    video {
      width: 100%;
      height: 100%;
      border-radius: 10px;
    }
  }
  .vide_title {
    height: 2rem;
    font-size: 0.9rem;
    padding-top: 0.5rem;
    color: #1a1a1a;
    line-height: 1.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding: 6px;
    /* padding-bottom: 12px; */
    margin-bottom: 10px;
  }
  .vide_bottom {
    margin-bottom: 26px;
    padding: 1px;
  }
  .tip_l {
    float: left;
    display: flex;
    align-items: center;
    img {
      width: 25px;
      height: 25px;
      border-radius: 50%;
    }
    span {
      margin-left: 3px;
    }
  }
  .tip_r {
    margin-top: 5px;
    float: right;
    display: flex;
    align-items: center;
    .van-rate {
      width: 20px;
      height: 20px;
      border-radius: 50%;
    }
    span {
      margin-left: 3px;
      color: #bcbbbb;
    }
  }
}
</style>